import { dateFormat } from '@/util/date';
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01';
let now = new Date();
now.setDate(now.getDate() + 1);
export const endDate = dateFormat(now, 'yyyy-MM-dd');
export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  delBtn:false,
  addBtn:false,
  viewBtn: true,
  detail: false,
  editBtnText: '领用',
  editBtn:false,
  arrow: false,
  printBtn:false,
  "column": [
    {
      "type": "input",
      "label": "唯一标识",
      "prop": "id",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "出库单ID",
      "prop": "outputStockid",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "出库单号",
      "prop": "outputStockno",
      "labelWidth":100,
      "search":true,
      display: false,
    }, {
      "type": "select",
      "label": "领用票种",
      "prop": "receiveCardType",
      display: false,
      search: true,
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
    }, {
      "type": "select",
      "label": "车票名称",
      "prop": "ticketName",
      display: false,
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      search: true,
      dicFlag: false,
    }, {
      "type": "input",
      "label": "车票次数",
      "prop": "ticketTimes",
      display: false,
    }, {
      "type": "number",
      "label": "车票金额",
      "prop": "ticketPrice",
	  precision: 2,
      display: false,
      sortable:false,
    }, {
      "type": "number",
      "label": "数量",
      "prop": "receiveNumber",
      display: false,
      sortable:false,
    },
    {
      "type": "input",
      "label": "车票库区",
      "prop": "receiveCardType",
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      display: false,
    },
     {
      "type": "input",
      "label": "库区分区",
      "prop": "stockArea",
      dicUrl: '/support/swpmticketarea/dict',
      props: {
        label: "ticketAreaName",
        value: "id"
      },
      display: false,
    }, {
      "type": "number",
      "label": "车票有效期(天)",
      "prop": "activeTime",
      display: false,
    }, {
      "type": "date",
      "label": "车票最晚启动日期",
      "prop": "latestStartTime",
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      display: false,
    }, {
      "type": "input",
      "label": "起号/止号",
      "prop": "ticketNo",
      display: false,
    },
    {
      "type": "datetime",
      "label": "出库时间",
      "prop": "outStorageTime",
      "format":"yyyy-MM-dd HH:mm:ss",
      "valueFormat":"yyyy-MM-dd HH:mm:ss",
      display: false,
    },
    {
      "type": "date",
      "label": "出库时间",
      "prop": "outStorageTimeDTO",
      "format":"yyyy-MM-dd",
      "valueFormat":"yyyy-MM-dd",
      "search":true,
      searchValue: [startDate, endDate],
      searchRange: true,
      searchSpan: 12,
      display: false,
      hide: true,
      showColumn: false
    },
    {
      "type": "select",
      "label": "领用人",
      "prop": "receiverName",
      display: false,
      component: 'user-select',
    }, {
      "type": "input",
      "label": "领用人工号",
      "prop": "receiverId",
      display: false,
    },
    {
      "type": "datetime",
      "label": "领用时间",
      "prop": "receiveTime",
      "format":"yyyy-MM-dd HH:mm:ss",
      "valueFormat":"yyyy-MM-dd HH:mm:ss",
      display: false,
      sortable: false,
    },
    {
      "type": "date",
      "label": "领用时间",
      "prop": "receiveTimeDTO",
      "format":"yyyy-MM-dd",
      "valueFormat":"yyyy-MM-dd",
      "search":true,
      display: false,
      hide: true,
      showColumn: false
    },
    {
      "type": "input",
      "label": "是否领用",
      "prop": "isReceive",
      display: false,
    }, {
      "type": "upload",
      "label": "附件",
      "prop": "file",
      component: "zd-upload",
	  dataType: 'string',
	  limit: 1,
      hide: true,
      display: false,
    }, {
      "type": "upload",
      "label": "图片",
      "prop": "picture",
      listType: 'picture-img',
      component: "zd-upload",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "备注",
      "prop": "remark",
      display: false,
    }, {
      "type": "input",
      "label": "创建人ID",
      "prop": "creatorId",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "创建人姓名",
      "prop": "creatorName",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      hide: true,
      display: false,
    }, {
		label: '出库人工号',
		prop: 'outputPersonCode',
		hide: true
	 }, {
		label: '出库人名称',
		prop: 'outputPersonName',   
		hide: true
	 }],
  group: [
    {
      label: '出库信息摘要',
      prop: 'ckxx',
      icon: 'el-icon-edit-outline',
      arrow: false,
      column: [{
        "type": "input",
        "label": "出库单编号",
        "prop": "outputStockno",
        detail: true,
      }, {
        "type": "datetime",
        "label": "出库时间",
        "prop": "outStorageTime",
        format: 'yyyy-MM-dd HH:mm:ss',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
        detail: true,
      },]
    }, {
      label: '出库明细',
      prop: 'ckmx',
      icon: 'el-icon-edit-outline',
      arrow: false,
      column: [{
        "type": "select",
        "label": "领用票种",
        "prop": "receiveCardType",
        dicUrl: '/support/swpmticketcardtype/dict',
        props: {
          label: 'mainName',
          value: 'mainEnName'
        },
        cascaderItem: ["ticketName"],
        //editDetail: true,
      }, {
        "type": "select",
        "label": "车票名称",
        "prop": "ticketName",
        dicFlag: false,
        props: {
          label: 'subName',
          value: 'subEnName'
        },
        component: 'ticket-name-select',
        params: {
          ticketAmountKey: 'ticketPrice',
          ticketCountKey: 'ticketTimes'
        },
        dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
        //editDetail: true,
      }, {
        "type": "number",
        "label": "车票次数",
        "prop": "ticketTimes",
        detail: true,
      }, {
        "type": "number",
        "label": "车票金额",
        "prop": "ticketPrice",
        precision: 2,
        detail: true,
      }, {
        "type": "number",
        "label": "数量",
        "prop": "receiveNumber",
        detail: true,
      }, {
        "type": "select",
        "label": "车票库区",
        "prop": "receiveCardType",
        dicUrl: '/support/swpmticketcardtype/dict',
        props: {
          label: 'mainName',
          value: 'mainEnName'
        },
        detail: true,
      }, {
        "type": "select",
        "label": "库存分区",
        "prop": "stockArea",
        dicUrl: '/support/swpmticketarea/dict',
        props: {
          label: "ticketAreaName",
          value: "id"
        },
        detail: true,
      }, {
        "type": "number",
        "label": "车票有效期",
        "prop": "activeTime",
        detail: true,
      }, {
        "type": "date",
        "label": "车票最晚启动日期",
        "prop": "latestStartTime",
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
        detail: true,
      }, {
        "type": "input",
        "label": "起号/止号",
        "prop": "ticketNo",
        detail: true,
      }, {
        dataType: 'string',
        "type": "upload",
        "label": "附件",
        "prop": "file",
        component: "zd-upload",
        limit: 1,
        disabled: true,
      }, {
        "type": "upload",
        "label": "图片",
        "prop": "picture",
        listType: 'picture-img',
        component: "zd-upload",
        disabled: true,
      },]
    }, {
      label: '领用信息',
      prop: 'lyxx',
      icon: 'el-icon-edit-outline',
      arrow: false,
      column: [{
        "type": "select",
        "label": "领用人",
        "prop": "receiverName",
      }, {
        "type": "input",
        "label": "领用人工号",
        "prop": "receiverId",
        detail: true,
      }, {
        "type": "datetime",
        "label": "领用时间",
        "prop": "receiveTime",
        format: 'yyyy-MM-dd HH:mm:ss',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
      }, {
        "type": "input",
        "label": "单位或部门",
        "prop": "receiverUnit",
        detail: true,
      }, {
        "type": "textarea",
        "label": "备注",
        "prop": "remark",
        span: 24,
      },]
    },
  ]
}

export const tableOptionLingYong = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  viewBtn: true,
  detail: false,
  editBtnText: '领用',
  arrow: false,
  submitBtn:false,
  emptyBtn:false,
  "column": [
    {
      "type": "input",
      "label": "唯一标识",
      "prop": "id",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "出库单ID",
      "prop": "outputStockid",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "出库单编号",
      "prop": "outputStockno",
      display: false,
    }, {
      "type": "select",
      "label": "领用票种",
      "prop": "receiveCardType",
      display: false,
      search: true,
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
    }, {
      "type": "select",
      "label": "车票名称",
      "prop": "ticketName",
      display: false,
      search: true,
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      dicFlag: false,
    }, {
      "type": "input",
      "label": "车票次数",
      "prop": "ticketTimes",
      display: false,
    }, {
      "type": "number",
      "label": "车票金额",
      "prop": "ticketPrice",
	  precision: 2,
      display: false,
      sortable:false,
    }, {
      "type": "input",
      "label": "数量",
      "prop": "ticketNumber",
      display: false,
      sortable:false,
    },
    // {
    //   "type": "input",
    //   "label": "车票库区",
    //   "prop": "stockArea",
    //   dicUrl: '/support/swpmticketarea/dict',
    //   props: {
    //     label: "ticketAreaName",
    //     value: "id"
    //   },
    //   display: false,
    // },
     {
      "type": "input",
      "label": "库区分区",
      "prop": "ticketarea",
      dicUrl: '/support/swpmticketarea/dict',
      props: {
        label: "ticketAreaName",
        value: "id"
      },
      display: false,
    }, {
      "type": "number",
      "label": "车票有效期",
      "prop": "activeTime",
      display: false,
    }, {
      "type": "input",
      "label": "车票最晚启动日期",
      "prop": "latestStartTime",
      display: false,
    }, {
      "type": "input",
      "label": "起号/止号",
      "prop": "ticketNo",
      display: false,
    }, {
      "type": "input",
      "label": "出库时间",
      "prop": "outStorageTime",
      display: false,
    }, {
      "type": "input",
      "label": "领用数量",
      "prop": "receiveNumber",
      display: false,
    },
    {
      "type": "select",
      "label": "领用人",
      "prop": "receiverName",
      display: false,
      component: 'user-select',
    }, {
      "type": "input",
      "label": "领用人工号",
      "prop": "receiverId",
      display: false,
    }, {
      "type": "input",
      "label": "领用时间",
      "prop": "receiveTime",
      display: false,
      sortable:false,
    }, {
      "type": "input",
      "label": "是否领用",
      "prop": "isReceive",
      display: false,
    }, {
      "type": "upload",
      "label": "附件",
      "prop": "file",
      component: "zd-upload",
	  dataType: 'string',
	  limit: 1,
      hide: true,
      display: false,
    }, {
      "type": "upload",
      "label": "图片",
      "prop": "picture",
      listType: 'picture-img',
      component: "zd-upload",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "备注",
      "prop": "remark",
      display: false,
    }, {
      "type": "input",
      "label": "创建人ID",
      "prop": "creatorId",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "创建人姓名",
      "prop": "creatorName",
      hide: true,
      display: false,
    }, {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      hide: true,
      display: false,
    }],
  group: [
    {
      label: '出库信息摘要',
      prop: 'ckxx',
      icon: 'el-icon-edit-outline',
      arrow: false,
      column: [{
        "type": "input",
        "label": "出库单编号",
        "prop": "outputStockno",
        detail: true,
        disabled:true,
      }, {
        "type": "datetime",
        "label": "出库时间",
        "prop": "outStorageTime",
        format: 'yyyy-MM-dd HH:mm:ss',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
        detail: true,
        disabled:true,
      },]
    }, {
      label: '出库明细',
      prop: 'ckmx',
      icon: 'el-icon-edit-outline',
      arrow: false,
      column: [{
        "type": "select",
        "label": "领用票种",
        "prop": "receiveCardType",
        dicUrl: '/support/swpmticketcardtype/dict',
        props: {
          label: 'mainName',
          value: 'mainEnName'
        },
        cascaderItem: ["ticketName"],
        detail: true,
        disabled:true,
      }, {
        "type": "select",
        "label": "车票名称",
        "prop": "ticketName",
        dicFlag: false,
        props: {
          label: 'subName',
          value: 'subEnName'
        },
        component: 'ticket-name-select',
        params: {
          ticketAmountKey: 'ticketPrice',
          ticketCountKey: 'ticketTimes'
        },
        dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
        detail: true,
        disabled:true,
      }, {
        "type": "number",
        "label": "车票次数",
        "prop": "ticketTimes",
        detail: true,
        disabled:true,
      }, {
        "type": "number",
        "label": "车票金额",
        "prop": "ticketPrice",
		precision: 2,
        detail: true,
        disabled:true,
      }, {
        "type": "number",
        "label": "数量",
        "prop": "receiveNumber",
        detail: true,
        disabled:true,
      }, {
        "type": "select",
        "label": "车票库区",
        "prop": "receiveCardType",
        dicUrl: '/support/swpmticketcardtype/dict',
        props: {
          label: 'mainName',
          value: 'mainEnName'
        },
        detail: true,
        disabled:true,
      }, {
        "type": "select",
        "label": "库存分区",
        "prop": "stockArea",
        dicUrl: '/support/swpmticketarea/dict',
        props: {
          label: "ticketAreaName",
          value: "id"
        },
        detail: true,
        disabled:true,
      }, {
        "type": "number",
        "label": "车票有效期",
        "prop": "activeTime",
        detail: true,
        disabled:true,
      }, {
        "type": "date",
        "label": "车票最晚启动日期",
        "prop": "latestStartTime",
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
        detail: true,
        disabled:true,
      }, {
        "type": "input",
        "label": "起号/止号",
        "prop": "ticketNo",
        detail: true,
        disabled:true,
      }, {
        dataType: 'string',
        "type": "upload",
        "label": "附件",
        "prop": "file",
        component: "zd-upload",
        limit: 1,
        disabled: true,
      }, {
        "type": "upload",
        "label": "图片",
        "prop": "picture",
        listType: 'picture-img',
        component: "zd-upload",
        disabled: true,
      },]
    }, {
      label: '领用信息',
      prop: 'lyxx',
      icon: 'el-icon-edit-outline',
      arrow: false,
      column: [
      //   {
      //   "type": "select",
      //   "label": "领用人",
      //   "prop": "receiverName",
      //   search: true,
      //   component: 'user-select',
      //   params: {
      //     userCodeKey: 'receiverId'
      //   },
      // }, {
      //   "type": "input",
      //   "label": "领用人工号",
      //   "prop": "receiverId",
      //   //detail: true,
      //   //disabled:true,
      // }, 

      {
        label: "领用人工号",
        prop: "receiverId",
        type: "select",
        component: "user-select",
        params: {
          prop: "receiverId",
          userCodeKey: "receiverName",
          labelKey: "userCode",
          valueKey: "nikename",
          allowCreate: true
        },
        dicQuery: {
          belongToLine: true
        },
      },{
        label: "领用人",
        prop: "receiverName",
        rules: [{
          required: true,
          message: '请输入领用人',
          trigger: 'blur'
        }]
      },
      {
        "type": "datetime",
        "label": "领用时间",
        "prop": "receiveTime",
        format: 'yyyy-MM-dd HH:mm:ss',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
      }, {
        "type": "input",
        "label": "单位或部门",
        "prop": "receiverUnit",
      }, {
        "type": "textarea",
        "label": "备注",
        "prop": "remark",
        span: 24,
      },]
    },
  ]
}
